// Copyright 叶湘 ( weixin:yexiang841, email:yexiang841@qq.com ), Shitouren Studio. All Rights Reserved.

#include "Hit/Q3D_CPPU_HitValue.h"
#include "Hit/Q3D_CPPU_Hit.h"
#include "Property/Q3D_CPPU_PropertyPLIPro.h"

void UQ3D_CPPU_HitValueBase::Q3D_F_HitValue_GetEnum(EQ3D_CPPE_HitValue &enum_hit_value) const
{
    enum_hit_value = EQ3D_CPPE_HitValue::Value_Int;
    return;
}

void UQ3D_CPPU_HitValueBase::Q3D_F_HitValue_Get(int32 &int_hit_value) const
{
    int_hit_value = 0;
    return;
}

void UQ3D_CPPU_HitValueInt::Q3D_F_HitValue_GetEnum(EQ3D_CPPE_HitValue &enum_hit_value) const
{
    enum_hit_value = EQ3D_CPPE_HitValue::Value_Int;
    return;
}

void UQ3D_CPPU_HitValueInt::Q3D_F_HitValue_Get(int32 &int_hit_value) const
{
    int_hit_value = this->Int_Value_Int;
    return;
}

void UQ3D_CPPU_HitValuePercentByMax::Q3D_F_HitValue_GetEnum(EQ3D_CPPE_HitValue &enum_hit_value) const
{
    enum_hit_value = EQ3D_CPPE_HitValue::Value_PercentByMax;
    return;
}

void UQ3D_CPPU_HitValuePercentByMax::Q3D_F_HitValue_Get(int32 &int_hit_value) const
{
    if (!this->Ptr_U_Hit)
    {
        int_hit_value = 0;
        return;
    }
    UQ3D_CPPU_PropertyPLIPro *ptr_u_property_pli_pro;
    FString string_log;
    this->Ptr_U_Hit->Q3D_F_PropertyPLIPro_Get(ptr_u_property_pli_pro, string_log);
    if (!ptr_u_property_pli_pro)
    {
        int_hit_value = 0;
        return;
    }
    int_hit_value = FMath::CeilToInt(this->Float_PercentByMax * ptr_u_property_pli_pro->Int_Max);
    return;
}

void UQ3D_CPPU_HitValuePercentByNow::Q3D_F_HitValue_GetEnum(EQ3D_CPPE_HitValue &enum_hit_value) const
{
    enum_hit_value = EQ3D_CPPE_HitValue::Value_PercentByNow;
    return;
}

void UQ3D_CPPU_HitValuePercentByNow::Q3D_F_HitValue_Get(int32 &int_hit_value) const
{
    if (!this->Ptr_U_Hit)
    {
        int_hit_value = 0;
        return;
    }
    UQ3D_CPPU_PropertyPLIPro *ptr_u_property_pli_pro;
    FString string_log;
    this->Ptr_U_Hit->Q3D_F_PropertyPLIPro_Get(ptr_u_property_pli_pro, string_log);
    if (!ptr_u_property_pli_pro)
    {
        int_hit_value = 0;
        return;
    }
    int_hit_value = FMath::CeilToInt(this->Float_PercentByNow * ptr_u_property_pli_pro->Int_Value);
    return;
}